home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 116 < prev    next >
Text File  |  1996-08-06  |  899b  |  44 lines

  1. Path: unix.sri.com!usenet
  2. From: mklenk@updike.sri.com (Mark Klenk)
  3. Newsgroups: comp.std.c
  4. Subject: ... char * * promotion to char const * const * ...
  5. Date: 16 Jan 1996 16:20:42 GMT
  6. Organization: Nuance Communications
  7. Message-ID: <4dgj8q$qin@unix.sri.com>
  8. Reply-To: mklenk@updike.sri.com
  9. NNTP-Posting-Host: 204.75.161.40
  10.  
  11.     My question is this:
  12.  
  13.     Why does a char * * not naturally promote to a
  14.     char const * const *?
  15.  
  16.     The following is legal and generates no compiler
  17.     warning:
  18.  
  19.         char const * foo;
  20.         char *       bar;
  21.  
  22.         foo = bar;
  23.         // bar = foo;  // Not allowed without cast.
  24.  
  25.  
  26.     But why not this:
  27.  
  28.         char const * const * foo_array;
  29.         char * *             bar_array;
  30.  
  31.         foo_array = bar_array;
  32.  
  33.     On every compiler I've tried, I get a warning about this,
  34.     something like "assignment from incompatible pointer type."
  35.  
  36.  
  37.     Can anyone clear this up for me?
  38. ---
  39.  
  40. mklenk@coronacorp.com       (Mark Klenk)
  41.  
  42.  
  43.  
  44.